Welcome to DataBase++ ver 2.00 ! -------------------------------- This file contains information pertaining to installing, compiling and using DataBase++. Please read it in it's entirety before using DataBase++. TABLE OF CONTENTS ----------------- 1. Contents 2. Installation 3. Overview 4. Compiling 5. Index File Information 6. Class Information 7. Ordering Information 8. Disclaimer 1. CONTENTS ------------ Several files are included with DataBase++. A listing of these files along with a brief description are as follows: FILE PUPRPOSE ---- -------- CLASSES.DOC Class documentation. DBPPDATA.HPP Declarations for class DBDatabase. DBPPDATA.CPP DBDatabase class definitions. DBPP200.TXT You are reading it! DBPP200.LIB DataBase++ library compiled for the large memory model. DBPPSTRU.HPP Declarations for class DBStructure. DBPPSTRU.CPP Definitions for class DBStructure. DBPPINDX.HPP Declarations for class DBIndex. DBPPINDX.CPP Definitions for class DBIndex. EXAMPLE*.CPP Examples. 2. INSTALLATION ---------------- To install DataBase++, make a directory on your system's hard disk and copy the entire contents of the DataBase++ disk. The path where the DataBase++ header files will be stored should be added to your compiler configuration files, make files and project files that will be used with DataBase++. The path where the DataBase++ library files will be stored should likewise be added to the appropriate configuration files, make files and project files. 3. OVERVIEW ----------- DataBase++ is a set of C++ classes designed to work in conjunction with Sequiter Software's CodeBase 5.0 database library for C. DataBase++ 2.00 was compiled with Borland C++ 4.0. It is designed to virtually remove the programmer from having to directly interface with CodeBase 5.0. No CodeBase initialization statements are required and in most programming cases, DataBase++ will handle every aspect of your program without resorting to direct CodeBase interaction. Access methods in DataBase++ provide the programmer with pointers to the CODEBASE and D4DATA structures if the programmer wants direct CodeBase access. DataBase++ was created by my own desire to use CodeBase in a higher level and in a totally Object Oriented manner. I wanted to have an Object represent a database file and be able to send messages to that object instead of having to handle database's in the traditional way. After looking at CodeBase++ and not being satisfied with it, I created DataBase++. There are quite a few advantages of using DataBase++. Below are just a few: - Completely upgraded to be compatable with CodeBase 5.0. - No need to initialize CodeBase. - No CodeBase structure references to manage. - One DataBase object per file for easy management. - Multi user friendly. - No need to manually unlock CodeBase index's after moving the record pointer in a multi-user environment. This is a CodeBase requirement and is handled automatically by DataBase++. - Supports all file formats that CodeBase does. - Easy creation of database and index files. - No cryptic function names. Use method names you are already familiar with like skip(), append(), goTo(), etc... 4. COMPILING ------------ There are several things to note when compiling your application with DataBase++. First, you MUST use all the switches you would normally use when compiling a CodeBase app. See your CodeBase manual for compile time switches. Second, CodeBase provides for combined index file emulation for Clipper .NTX and dBASE .NDX index files. This is done by CodeBase creating .CGP files which contain information on which index files are associated with the given data file. If you want to use this capability with DatBase++, you must define INDEX_GROUPS in addition to the CodeBase compile time switches when compiling your app. Otherwise normal index files will be created and used. If using Foxpro .CDX index files, make sure that INDEX_GROUPS IS NOT defined. See CLASSES.DOC under the section for class DBIndexTag for more details. The name of the DataBase++ library file for the large memory model is DBPPL.LIB. The examples below use DBASE.LIB, B4FOX.LIB and B4CLIP.LIB for reference the the CodeBase libraries. Your CodeBase library files may be named differently. Check with your CodeBase documentation. Examples using the Borland C++ compile: For dBASE using .NDX index files, no combined indexes: bcc -ml -DS4NDX yourfile.cpp b4dbase.lib dbppl.lib emu.lib mathl.lib cl.lib For dBASE using .NDX index files with combined index emulation: bcc -ml -DS4NDX;INDEX_GROUPS yourfile.cpp b4dbase.lib dbppl.lib emu.lib mathl.lib cl.lib For Foxpro using .CDX index files: bcc -ml -DS4FOX yourfile.cpp b4fox.lib dbppl.lib emu.lib mathl.lib cl.lib For Clipper .NTX files, no combined indexes: bcc -ml -DS4CLIPPER yourfile.cpp b4clip.lib dbppl.lib emu.lib mathl.lib cl.lib For Clipper .NTX files with combined index emulation: bcc -ml -DS4CLIPPER;INDEX_GROUPS yourfile.cpp b4clip.lib dbppl.lib emu.lib mathl.lib cl.lib Notice that emu.lib and mathl.lib are included. If your app. will run on a machine that has a floating point processor, substitute them with the appropriate libraries. CodeBase requires floating point functions. 5. INDEX FILE INFORMATION ------------------------- DataBase++ supports all index file types that CodeBase does. You must be sure to compile your app. with the proper S4 type switches for proper index file operation. If you purchase DataBase++, you will be able to compile the source code for DataBase++ and create your own libraries. If you do, you must also be sure to use the same S4 switches when compiling DataBase++. The S4 switches are as follows: S4FOX - FoxPro .CDX files. S4NDX - dBASE III .NDX files. S4CLIPPER - Clipper .NTX files. There are more switch combinations for CodeBase. See your CodeBase manual for more information. If you purchase DataBase++ and are not using FoxPro .CDX file formats, you may compile DataBase++ and your app. with the INDEX_GROUPS compile switch to give your app. combined index emulation. This will create a .CGP file for each database file, which lists all your index files for that .DBF. When you open your database file with the open() method and you are using combined index file emulation or are using FoxPro .CDX formats, all index files are automatically opened with the database file. See your CodeBase documentation for more information on .CGP combined index emulation. Opening and selecting index files: If you are using an index file format which utilizes combined index file emulation, the index files are opened with the database. Therefore, selecting an index requires only that you call the setIndexTag() method. NOTE: The DBDatabase::openIndex() method is pre-processed out if you are using combined index file emulation. Example: db.open(); db.setIndexTag( "name" ); If you are NOT using an index file format which utilizes combined index file emulation, the index files MUST be opened before you attempt to select them. Failure to do so will yield a CodeBase error. You use the openIndex() method to open the index files. There is no need to specify an index file extension when calling openIndex() as CodeBase will know which default index file extension is used by the compile time switched you use and which CodeBase library you are linking in. Selecting an index is still accomplished with the setIndexTag() method. The last index file to be opened is the currently selected index. Example: db.open(); db.openIndex( "name" ); // Open it. db.setIndexTag( "name" ); // Select it. 6. CLASS INFORMATION -------------------- DataBase++ consists of several classes organized under one base class. Below is a diagram of the class heirarchy. More detailed information on class methods may be found in the file CLASSES.DOC: DBObject // Parent class. DBDatabase // Database class. DBIndex // Represent an index. DBIndexTag // Contains a DBArray of DBIndex's. DBField // Represent a database field. DBStructure // Contains a DBArray of DBField's. DBArray // Array type of DBObject pointers. DBObject: Parent class for all classes in DataBase++. At this time, it essentially does nothing. It's main purpose is to provide a common root for the DBArray class. It should be noted that utilizing templates in a compiler such as Borland C++ 3.0 or above would make storing object pointers of differing types a bit easier, but I can't plan on everyone having a compiler that supports them. DataBase++ was written in Borland C++ 4.0; and the original versions did use templates. DBIndex: Represents an index structure. This is really a structure that contains fields to hold the index tag name and expression. DBIndexTag: Comprised of a DBArray of DBIndex pointers, this class is responsible for creation and manipulation of a set of indexes for a given data file. DBIndex object pointers are added by the addTag() method. DBField: Represents a database field. This is really a structure that contains fields for name, type, length and decimals. DBStructure: Comprised of a DBArray of DBField object pointers, this class is responsible for the creation of a database structure. DBField pointers are added by the addField() method. DBArray: Stores DBObject pointers. 7. ORDERING INFORMATION ----------------------- DataBase++ 2.00 is considered ShareWare. If you find these classes useful, please support its continuation by registering. Upon registration, you will receive all source code for DataBase++ 2.00. DataBase++ is available for a fee of $45.00, which includes the cost of shipping within the US. For that amount, you will receive all source code and can alter that code for your own purposes. Send orders to: Jeff Stapleton 15 Hampton Rd. Montgomery, IL 60538 or contact me on Compuserve at 70134,1001 Please specify that you are ordering DataBase++ ver. 2.00 when ordering. 8. DISCLAIMER ------------- DataBase++ is sold with no warrantee, either expressed or implied. The author assumes no responsibility for any damage caused as a result of using this product. CodeBase and CodeBase 5.0 are registered trademarks of Sequiter Software. Borland C++ is a registered trademark of Borland International. // eof DBPP.DOC